package it.bradipao.deschartsdemo;

import it.bradipao.deschartsdemo.slice.MainAbilitySlice;

import ohos.aafwk.ability.fraction.FractionAbility;
import ohos.aafwk.content.Intent;
import ohos.multimodalinput.event.KeyEvent;

/**
 * MainAbility
 *
 * @since 2021-08-02
 */
public class MainAbility extends FractionAbility {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setMainRoute(MainAbilitySlice.class.getName());
    }

    @Override
    public boolean onKeyUp(int keyCode, KeyEvent keyEvent) {
        if (keyCode == KeyEvent.KEY_BACK) {
            MainAbilitySlice.Save.currentIndex = 0;
        }
        return super.onKeyUp(keyCode, keyEvent);
    }
}
